The solution for aggregation of timestamp durations is to use timestampdiff , a built - in udf user defined function that is included with db2 udb , as shown in the following example 解决持续时间的聚合问题可以使用timestampdiff ,如下面的样本实例中所显示,它是使用db2 udb实现的嵌入式udf (用户定义的功能) 。